package com.future;

/**
 * Description:
 *
 * @Author: future
 * @Date:2022/3/3:23:43
 */
public class Solution_findMaximumXOR_421 {

    public static void main(String[] args) {
        int[] nums = {3, 10, 5, 25, 2, 8};
        nums = new int[]{2, 4};
        findMaximumXOR(nums);
    }

    public static int findMaximumXOR(int[] nums) {
        if (nums == null || nums.length < 2) {
            return 0;
        }
        int ans = 0;
        for (int i = 0; i < nums.length; i++) {
            int first = nums[i];
            for (int j = 0; j < nums.length; j++) {
                ans = Math.max(ans, first ^ nums[j]);
            }
        }
        return ans;
    }
}
